import annotation.MyAnnotation;
import lombok.NonNull;
import org.junit.Test;

import java.lang.reflect.Method;

/**
 * Created by VincentZee on 2019/3/7
 */
public class TestAnnotation {

    // checker framework
    private @NonNull Object object = null;

    @Test
    public void test01() throws NoSuchMethodException {
        Class<TestAnnotation> clazz = TestAnnotation.class;
        Method method = clazz.getMethod("show", String.class);
        MyAnnotation[] annotations = method.getAnnotationsByType(MyAnnotation.class);
        for (MyAnnotation myAnnotation : annotations){
            System.out.println(myAnnotation.value());
        }
    }

    @MyAnnotation("hello")
    @MyAnnotation("world")
    public void show(@MyAnnotation("asd") String str){
    }
}
